import pandas as pd
def miss_values_table(df):
    # Total missing values  Series
    mis_value = df.isnull().sum()
    # print(mis_value)
    # Percentage of missing values
    mis_values_percent = 100 * mis_value / len(df)
    # Make a table with the result
    mis_val_table = pd.concat([mis_value,mis_values_percent],axis=1)
    # rename the columns
    mis_val_table_ren_columns = mis_val_table.rename(
        columns = { 0 : 'Missing Values', 1: '% of Total Values'}
    )
    # Sort the table by percentage of missing descending
    mis_val_table_ren_columns = (mis_val_table_ren_columns[mis_val_table_ren_columns.iloc[:,1] !=0 ]
                                 .sort_values('% of Total Values',ascending=False)).round(1)
    print("Your selected dataframe has " + str(df.shape[1]) + " columns. \n"
          "there are " + str(mis_val_table_ren_columns.shape[0]) + " columns that have missing values"
          )
    # print(mis_val_table_ren_columns)
    # Return the dataframe with missing information
    return mis_val_table_ren_columns